'use strict'
const { Text, View } = window.QUI
import style from './css.css'
class Index extends React.Component {
  constructor (props) {
    super(props)
    this.state = { date: new Date() }
  }

  componentDidMount () {
    this.timerID = setInterval(
      () => {
        this.setState({
          date: new Date()
        })
      },
      1000
    )
  }

  componentWillUnmount () {
    clearInterval(this.timerID)
  }

  tick () {

  }
  render () {
    return (
      <View className={ style.container } >
        <Text>It is {this.state.date.toLocaleTimeString()}.</Text>
      </View>
    )
  }
}
export default Index
